package com.glls.customer.feign;


import com.glls.common.entity.Goods;
import com.glls.customer.feign.fallback.SearchFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@FeignClient(value = "service-search",fallback = SearchFeignClientFallBack.class)
public interface SearchFeignClient {

    @RequestMapping("/search/findGoodsById")
    public Goods search(@RequestParam("id") Integer id);



    @GetMapping(value = "/search/search")
    public Goods search(@RequestParam("id") Integer id,@RequestParam("name") String name);

    @GetMapping("/search/{id}")
    public Goods findJifenById(@PathVariable(value = "id") Integer id);

    @PostMapping(value = "/search/save")
    public Map saveGoods(@RequestBody Goods goods);

    @PostMapping(value = "/search/update")
    public Map update(@RequestBody Goods goods);

    @GetMapping(value = "/search/delete")
    public Map deleteById(@RequestParam("id") Integer id);
}
